<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li><a ui-sref="main.hui.subscribe.list" href="">订阅管理</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 内容区域 -->
<div class="wrapper-md content">
    <div class="panel panel-default">
        <!-- 头部 -->
        <div class="panel-heading font-bold">{{title}}
            <a class="btn btn-sm btn-icon btn-rounded btn-default pull-right m-t-n-xs" ui-sref="main.hui.subscribe.list"><i class="text-md fa fa-times text-muted"></i></a>
        </div>
        <!--表单-->
        <div class="panel-body">
            <form class="form-horizontal"  name="subscribe_form" id="subscribeform">
                <input type="hidden" ng-model="record.subscribeId">
                <!--来源渠道-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>渠道来源:</label>
                    <div class="col-sm-6">
                        <select class="form-control" ng-model="record.channelNo"
                                ng-options="d.channelNo as d.channelName for d in channelList" id="channelNo" name="channelNo">
                            <option value="">--选择渠道--</option>
                        </select>
                        <span class="help-block m-b-none"></span>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!--消息标题-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>消息标题:</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" placeholder="请输入消息标题" ng-model="record.messageTitle" id="messageTitle" name="messageTitle">
                        <span class="help-block m-b-none"></span>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!--消息内容-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>消息内容:</label>
                    <div class="col-sm-6">
                        <textarea rows="5" class="form-control" placeholder="请输入消息内容"ng-model="record.messageComments" id="messageComments" name="messageComments">
                        </textarea>
                        <span class="help-block m-b-none"></span>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!--消息详情-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>消息详情:</label>
                    <div class="col-sm-6">
                        <textarea rows="5" class="form-control" placeholder="请输入消息详情"ng-model="record.messageDetail" id="messageDetail" name="messageDetail">
                        </textarea>
                        <span class="help-block m-b-none"></span>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!-- 消息图标-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label" for="messageIcon"><span class="text-danger wrapper-sm">*</span>消息图标:</label>
                    <div class="col-sm-6">
                        <div class="previewWrap fl">
                            <up-huiload multi="1" draggable="true" data='detailImgData' size="310" ratio='' class="previewMain">
                                <div class="upLoadImgWrap">
                                    <div class="preViewImgWrap fl" ng-repeat="preImg in detailImgData">
                                        <div class="preViewImg">
                                            <div class="picItem">
                                                <div class="mask"><span class="reUpLoad" index="{{$index}}">重新上传</span></div>
                                                <div><img ng-src="{{preImg.src[0]}}" onload="if(this.width>=this.height){this.style.width='100%'}else{this.style.height='100%'}"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div ng-show="detailImgData.length<1" class="clear">
                                        <div class="text fl" ng-show="detailImgData.length<1">
                                            点击上传图片<br>(请上传300KB以内图片)<br>(限jpg/png/jpeg)
                                        </div>
                                        <label class="upLoadImg fl" for="uploadFile">
                                            <img src="res/img/addPic.png" alt="">
                                            <input type="file" accept="image/png,image/gif,image/jpeg" id="uploadFile" autocomplete="off">
                                        </label>
                                    </div>
                                </div>
                            </up-huiload>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!--页面样式-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>页面样式:</label>
                    <div class="col-sm-6">
                        <select class="form-control" ng-model="record.pageStyle" style="color: black"
                               id="pageStyle" name="pageStyle" >
                            <option value="">--选择页面样式--</option>
                            <option value="1">--图片居中--</option>
                            <option value="2">--图片居左--</option>
                            <option value="3">--无图片环绕--</option>
                        </select>
                        <span class="help-block m-b-none"></span>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!--消息url跳转地址-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>url地址:</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" placeholder="请输入跳转url" ng-model="record.innerUrl" id="innerUrl" name="innerUrl" ng-focus = "alertmes()" >
                        <span class="help-block m-b-none"></span>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"></div>
                {{openPlatforms.indexOf('ld')}}

                <!--选择分发平台-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>选择分发平台:</label>
                    <div class="col-sm-6" style="top: 10px;">
                        <input type="checkbox" name="selectall"  ng-click="selected()" />
                        全选
                        <input type="checkbox"   name="openPlatform" value="lbjr" />
                        联璧金融
                        <input type="checkbox"  name="openPlatform" value="ld"   />
                        铃铛
                        <input type="checkbox"  name="openPlatform" value="lbn"   />
                        老板娘
                        <input type="checkbox" name="openPlatform"  value="zqh"  />
                        智仟汇
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <div class="col-sm-6 col-sm-offset-2" >
                        <button type="reset" class="btn btn-default w-xs">重置</button>
                        <button type="submit" class="btn btn-info w-xs m-l-xl" ng-disabled="isDisabled" >保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<style>
     .record{
        width: 70%;
    }
     .radio{
        min-width: 120px;
    }
     .previewWrap{
        width:500px;
        padding-bottom: 10px;
        border:1px solid #d3d3d3;
    }
     .previewWrap .text{
        margin-top:50px;
    }
    .MR10{
        margin-right: 10px;
    }
    .previewWrap{
        text-align: center;
        margin-right: 10px;
        margin-bottom: 20px;
    }
    .previewWrap .preview{
        width: 330px;
        height: 270px;
        border: 1px solid #d6d5d5;
        margin-top: 10px;
    }
    .previewWrap .preview .title{
        padding:10px;
        font-size: 12px;
        text-align: left;
    }
    .previewWrap .upLoadImg{
        width: 140px;
        height: 140px;
        border:1px dashed #d6d5d5;
        padding-top: 38px;
        margin:15px 0 0 30px;
        display:inline-block;
        background: url('res/img/addPic.png') no-repeat center;
        cursor: pointer;
    }
    .previewWrap .preview .text{
        color:#d6d5d5;
        padding-top: 20px;
    }

    .previewWrap .text{
        padding:13px 50px;
        /*margin-top: 50px;*/
    }
    .previewWrap .preViewImgWrap{
        margin: 15px;
    }
    .previewWrap .preViewImg{
        width:150px;
        height:150px;
        overflow: hidden;
    }
    .fl{
        float:left;
    }
    input[type="file"]{
        display: none;
    }
    .previewMain{
        /*height:86%;*/
    }

    .preViewImg{
        width:300px;
        height:190px;
        overflow: hidden;
    }
    .preViewImg img{
        /*width: 100%;*/

    }
    .preViewImg .picItem{
        height: 100%;
        position: relative;
    }
    .preViewImg .mask + div{
        height: 100%;
        width: 100%;
    }
    .picItem:hover .mask{
        height:100%;
    }
    .preViewImg .mask{
        position: absolute;
        overflow: hidden;
        height:0;
        width: 100%;
        background:rgba(0,0,0,0.5);
        transition: all 0.3s;
    }
    .preViewImg span{
        position:absolute;
        width: 80px;
        height:34px;
        border-radius: 17px;
        line-height: 34px;
        text-align: center;
        color: #fff;
        cursor: pointer;
        background:deepskyblue;
        left:50%;
        top:50%;
        font-size: 12px;
        transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
    }
</style>